# 作者: 家里蹲 吴越洋
# 2023年03月09日18时50分03秒

from multiprocessing import Queue,Process
import time

def put_proc(q:Queue):
    for i in range(4):
        q.put(i)
        time.sleep(1)

def get_proc(q:Queue):
    while q.qsize():
        c=q.get()
        print(c)
        time.sleep(2)

if __name__ == '__main__':
    queue=Queue()
    p1=Process(target=put_proc,args=(queue,))
    p2 = Process(target=get_proc, args=(queue,))
    p1.start()
    p2.start()
    p1.join()
    p2.join()